<template>
    <el-carousel
            :interval="4000"
            type="card"
            height="550px">
        <el-carousel-item v-for="(drug,index) in hotDrugs" :key="index">
            <img :src="drug.url">
            <div class="content">
                <h1>{{drug.name}}</h1>
            </div>
        </el-carousel-item>
    </el-carousel>
</template>

<script type="text/ecmascript-6">
  export default {
    props: {
      hotDrugs: {
        type: Array
      }
    }
  }
</script>

<style lang="stylus" rel="stylesheet/stylus">
    .el-carousel__item {
        box-shadow 0 0 100px darkgray

        img {
            width 100%
            height 100%
        }

        .content {
            position absolute
            top -10px
            left 0
            right 0

            h1 {
                text-align center
            }
        }
    }
</style>
